package com.foodplus.www.model.impl;

import com.foodplus.www.api.RetrofitManager;
import com.foodplus.www.bean.login.MemberDataBean;
import com.foodplus.www.bean.login.MyAssetBean;
import com.foodplus.www.model.IUserDataModel;

import java.util.Map;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by WangZhiChao on 2016/11/2.
 */

public class UserDataModelImpl implements IUserDataModel {
    @Override
    public void getMyAsset(Subscriber<MyAssetBean> subscriber, Map<String, String> params) {
        RetrofitManager
                .getInstance()
                .getLoginService()
                .getMyAsset(params)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    @Override
    public void getMemberData(Subscriber<MemberDataBean> subscriber, Map<String, String> params) {
        RetrofitManager
                .getInstance()
                .getLoginService()
                .getMemberData(params)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }
}
